Skip to content

feat: Add dbtool command to restore recovered data#3451

Open
sadhansood wants to merge 1 commit into
mainfrom
sadhan/restore_command
Open

feat: Add dbtool command to restore recovered data#3451
sadhansood wants to merge 1 commit into
mainfrom
sadhan/restore_command

Conversation

@sadhansood

Copy link
Copy Markdown
Contributor

Description

This is a dbtool command to replace corrupted CF with data from a restored one. User passes in CF mappings b/w two databases and it copies data over one at a time.

Test plan

Unit tests.

@sadhansood sadhansood changed the title feat: Add dbtool command to restore recovred data feat: Add dbtool command to restore recovered data Jun 5, 2026
@sadhansood sadhansood force-pushed the sadhan/restore_command branch 3 times, most recently from 9476323 to 5d9f798 Compare June 5, 2026 19:12
@sadhansood sadhansood force-pushed the sadhan/restore_command branch from 5d9f798 to d81d928 Compare June 5, 2026 19:25

@halfprice halfprice left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @sadhansood! The tool LGTM (and assume you have tried to use it successfully). Have a few comments for you to consider.


const RESTORE_CF_WRITE_BATCH_SIZE: usize = 10_000;

fn restore_column_families(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remark: should we consider take stoarge node config as input so that users' local DB config is applied in the restored CF?

Comment thread Cargo.toml
"crates/walrus-upload-relay",
"crates/walrus-utils",
]
exclude = ["crates/rocksdb"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: what is this for?


/// A mapping from an input RocksDB column family to an output Walrus DB column family.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ColumnFamilyMapping {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can you add examples to show how to use this command in the PR description and the commandline helper string? The input and output are just string makes it too free to set.

output: String,
}

fn parse_column_family_mapping(value: &str) -> std::result::Result<ColumnFamilyMapping, String> {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: use anyhow::result ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants